package com.maze.game.factory
{
	import com.maze.app.AppText;
	import com.maze.game.model.Level;

	public class LevelFactory
	{
		private static var _instance:LevelFactory = null;
		
		public function LevelFactory(enforcer:SingletonEnforcer)
		{
			if (_instance != null) { throw new Error(AppText.ERROR_SINGLETON_INSTANCE); }
		}
		
		public static function getInstance():LevelFactory
		{
			if(_instance == null)
			{
				_instance = new LevelFactory(new SingletonEnforcer());
			}
			return _instance;
		}
		
		public function getLevel1():Level
		{
			var level1:Level = new Level();
			level1.boardWidth = 550;
			level1.boardHeight = 550;
			level1.data = [
				[1,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
				[1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
				[1,0,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1],
				[1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1],
				[1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1],
				[1,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1],
				[1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1],
				[1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,1],
				[1,1,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1],
				[1,0,0,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1],
				[1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1],
				[1,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,1],
				[1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1],
				[1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,1],
				[1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1],
				[1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,1,0,1],
				[1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1],
				[1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,9],
				[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
			];
			return level1;
		}
	}
}
class SingletonEnforcer {}